<link href="/res/css/common/baseAzt.css" rel="stylesheet" type="text/css" />
<link href="/res/css/common/backheadfoot.css" rel="stylesheet" type="text/css" />
<link href="/res/css/common/headfoot.css" rel="stylesheet">
<link href="/res/third/layer/skin/default/layer.css" rel="stylesheet">
<style>
	.newHead .w1200 img.hot{
		margin-top: 0px;
	    position: absolute;
	    top: -8px;
	    right: -20px;
	}
</style>
[@front_head]
<div class="newHead fixHead">
    <div class="w1200">
        <img style="cursor: pointer;" alt="网上采购平台" src="/res/images/common/head/logo.png" onclick="window.open('/')"/>  
        <ul>
            <li [#if link?? && link='index']class="on"[/#if]>
            <a href="/" target="_blank">首页</a>
            </li>
            <li [#if link?? && link='enquiry']class="on"[/#if]>
                <a href="/enquiry/all/choose" target="_blank">我要询价</a>
            </li>
            <li [#if link?? && link='xmh']class="on"[/#if]>
                <a href="/xmh" target="_blank">我要报价</a>
            </li>
           <!--  <li [#if link?? && link='entrust']class="on"[/#if]>委托采购</li> -->
            <li [#if link?? && link='cooperation']class="on"[/#if]>
            	 <a style="position: relative;" href="/member" target="_blank">安装商城<img class="hot" src="/res/images/i-hot.png" alt=""></a>
            </li> 
            <li [#if link?? && link='integral']class="on"[/#if]>
            <a href="/integral/integralShop" target="_blank">好礼兑换</a>
            </li>
            [#if Session.currentUser??]
            <li [#if link?? && link='finance']class="on"[/#if]>
                <a href="/finance" target="_blank">金融服务</a>
            </li>
            [/#if]
        </ul>  
        <div class="comIntroOuter"  title="[#if currentUser?? && currentUser.company??][#if topCompany?? && currentUser.company.parentId??]${topCompany.companyName!}-${currentUser.company.companyName!}[#else]${currentUser.company.companyName!}[/#if][/#if]">
        [#if currentUser??]
            <div class="comIntro">
                <h6>
                    [#if currentUser.company??]
                    [#if topCompany?? && currentUser.company.parentId??]
                    [@content_cut content=topCompany.companyName!-currentUser.company.companyName! len=10 ending="..." /]
                    [#else]
                    [@content_cut content=currentUser.company.companyName! len=10 ending="..." /]
                    [/#if]
                    [/#if]
                </h6>
                <h6 class="comName" onclick="javascript:location.href='/safecenter/personalData'">
                    [#if  currentUser.realName??][#assign name='${currentUser.realName!}' /]
                    [#elseif currentUser.email??][#assign name='${currentUser.email!}' /]
                    [#elseif currentUser.mobile??][#assign name='${currentUser.mobile!}' /][/#if]
                    [#if name??]${name!}[/#if]
                </h6>
                 <ul>
                        <li class="arrow"></li>
                        <li class="myAzt" onclick="window.open('/user/userCenter')">用户中心</li>
                        [#if canSwitch]
                            [#if Session.currentRole.roleType == 1]
                                <li class="swt" onclick="switchRole()">切换到供应商</li>
                            [#else]
                                <li class="swt" onclick="switchRole()">切换到采购商</li>
                            [/#if]
                        [/#if]
                        <li class="help" onclick="window.open('/sysfoot/helpCenter')">帮助中心</li>
                        <li class="ext" onclick="logout()">退出</li>
                    </ul>
            </div>
            <div class="toCenter" onclick="window.open('/user/userCenter')">
            </div>
            <div class="comLogoOuter">
                <div class="comLogo">
                    [#if companyInfo?? && companyInfo.logo?? && companyInfo.logo != '']
                        <img alt="logo" src="${companyInfo.logo!}"/>
                    [#else]
                        <img alt="logo" src="/res/images/common/userLogo_05.png"/>
                    [/#if]
                </div>
            </div> 
        [#else]
            <a href="/user/login">登录</a>
            <a class="on" style="margin-left: -3px;" href="/user/register">免费注册</a>
        [/#if]
        </div> 
    </div>
</div>
[/@front_head]

<script src="/res/js/common/jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
	 
    function logout() {  
        $.post('/user/logout', function() {  
            location.replace('/'); 
        }); 
    }

    function switchRole() {
        $.post('/user/switch', function(data){
            if(data.success){
                location.replace('/');
            }else{
                alert(data.msg);
            }
        },"json");
    }
    $(".comIntroOuter a").hover(function(){
    	$(this).addClass("on");
    	$(this).siblings("a").removeClass("on");
    });
</script>
